import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'

// https://vite.dev/config/
export default defineConfig({
  plugins: [vue()],
  server: {
    host: '0.0.0.0',
    port: 3000,
    open: true, // 关键配置：启动后自动打开浏览器
    proxy: {
      // '/api': {
      //   target: '你接口的域名',	//实际请求地址
      //   changeOrigin: true,
      //   rewrite: (path) => path.replace(/^\/api/, '')
      // },
    }
  },
  resolve: {
    alias: {
      '@': path.resolve(__dirname, 'src')
    }
  },
  css: {
    // css预处理器
    preprocessorOptions: {
      scss: {
        additionalData: '@use "@/assets/style/mixin.scss" as *;'
      }
    }
  }
})